const elevator = document.querySelector('.xtx-elevator');
const toTop = document. querySelector('#backTop');
//监听window滚动事件
window.addEventListener('scroll', function () {
    const n = dooument.documentElement.scrollTop
    elevator.style.opacity = n >= 300 ? '1' : '0'
})//获得html被卷去的头部尺寸const n = dooument.documentElement.scrollTop
    //判断是否满足条件// if (n >= 300) {//elevator.style.opacity = I!//}else (elevator.style.opacity = 'gI13})
    
//给按钮添加点击事件，点击以后回到顶点toTop.addEventListener('click', function () {window.scrollTo(图，@)